package com.hacoc.countdown.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="count_down"
 *     
*/
public class CountDown implements Serializable {

    /** identifier field */
    private String countDownId;

    /** nullable persistent field */
    private String mainTitle;

    /** nullable persistent field */
    private String subTitle;

    /** nullable persistent field */
    private Date date;

    /** nullable persistent field */
    private String url;

    /** nullable persistent field */
    private String info;

    /** nullable persistent field */
    private Integer tops;

    /** nullable persistent field */
    private String logo;

    /** nullable persistent field */
    private Integer backColor;

    /** nullable persistent field */
    private String remarks;

    /** persistent field */
    private com.hacoc.countdown.model.TagType tagType;

    /** persistent field */
    private com.hacoc.countdown.model.CountDownState countDownState;

    /** persistent field */
    private com.hacoc.countdown.model.HolidayType holidayType;

    /** persistent field */
    private Set myCountDowns;

    /** persistent field */
    private Set favorites;

    /** full constructor */
    public CountDown(String countDownId, String mainTitle, String subTitle, Date date, String url, String info, Integer tops, String logo, Integer backColor, String remarks, com.hacoc.countdown.model.TagType tagType, com.hacoc.countdown.model.CountDownState countDownState, com.hacoc.countdown.model.HolidayType holidayType, Set myCountDowns, Set favorites) {
        this.countDownId = countDownId;
        this.mainTitle = mainTitle;
        this.subTitle = subTitle;
        this.date = date;
        this.url = url;
        this.info = info;
        this.tops = tops;
        this.logo = logo;
        this.backColor = backColor;
        this.remarks = remarks;
        this.tagType = tagType;
        this.countDownState = countDownState;
        this.holidayType = holidayType;
        this.myCountDowns = myCountDowns;
        this.favorites = favorites;
    }

    /** default constructor */
    public CountDown() {
    }

    /** minimal constructor */
    public CountDown(String countDownId, com.hacoc.countdown.model.TagType tagType, com.hacoc.countdown.model.CountDownState countDownState, com.hacoc.countdown.model.HolidayType holidayType, Set myCountDowns, Set favorites) {
        this.countDownId = countDownId;
        this.tagType = tagType;
        this.countDownState = countDownState;
        this.holidayType = holidayType;
        this.myCountDowns = myCountDowns;
        this.favorites = favorites;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *             type="java.lang.String"
     *             column="count_down_id"
     *         
     */
    public String getCountDownId() {
        return this.countDownId;
    }

    public void setCountDownId(String countDownId) {
        this.countDownId = countDownId;
    }

    /** 
     *            @hibernate.property
     *             column="main_title"
     *             length="100"
     *         
     */
    public String getMainTitle() {
        return this.mainTitle;
    }

    public void setMainTitle(String mainTitle) {
        this.mainTitle = mainTitle;
    }

    /** 
     *            @hibernate.property
     *             column="sub_title"
     *             length="100"
     *         
     */
    public String getSubTitle() {
        return this.subTitle;
    }

    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    /** 
     *            @hibernate.property
     *             column="date"
     *             length="10"
     *         
     */
    public Date getDate() {
        return this.date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    /** 
     *            @hibernate.property
     *             column="url"
     *             length="100"
     *         
     */
    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    /** 
     *            @hibernate.property
     *             column="info"
     *             length="200"
     *         
     */
    public String getInfo() {
        return this.info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    /** 
     *            @hibernate.property
     *             column="tops"
     *             length="11"
     *         
     */
    public Integer getTops() {
        return this.tops;
    }

    public void setTops(Integer tops) {
        this.tops = tops;
    }

    /** 
     *            @hibernate.property
     *             column="logo"
     *             length="200"
     *         
     */
    public String getLogo() {
        return this.logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    /** 
     *            @hibernate.property
     *             column="back_color"
     *             length="11"
     *         
     */
    public Integer getBackColor() {
        return this.backColor;
    }

    public void setBackColor(Integer backColor) {
        this.backColor = backColor;
    }

    /** 
     *            @hibernate.property
     *             column="remarks"
     *             length="200"
     *         
     */
    public String getRemarks() {
        return this.remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="tag_id"         
     *         
     */
    public com.hacoc.countdown.model.TagType getTagType() {
        return this.tagType;
    }

    public void setTagType(com.hacoc.countdown.model.TagType tagType) {
        this.tagType = tagType;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="state_id"         
     *         
     */
    public com.hacoc.countdown.model.CountDownState getCountDownState() {
        return this.countDownState;
    }

    public void setCountDownState(com.hacoc.countdown.model.CountDownState countDownState) {
        this.countDownState = countDownState;
    }

    /** 
     *            @hibernate.many-to-one
     *             not-null="true"
     *            @hibernate.column name="holiday_type_id"         
     *         
     */
    public com.hacoc.countdown.model.HolidayType getHolidayType() {
        return this.holidayType;
    }

    public void setHolidayType(com.hacoc.countdown.model.HolidayType holidayType) {
        this.holidayType = holidayType;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="count_down_id"
     *            @hibernate.collection-one-to-many
     *             class="com.hacoc.countdown.model.MyCountDown"
     *         
     */
    public Set getMyCountDowns() {
        return this.myCountDowns;
    }

    public void setMyCountDowns(Set myCountDowns) {
        this.myCountDowns = myCountDowns;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="count_down_id"
     *            @hibernate.collection-one-to-many
     *             class="com.hacoc.countdown.model.Favorite"
     *         
     */
    public Set getFavorites() {
        return this.favorites;
    }

    public void setFavorites(Set favorites) {
        this.favorites = favorites;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("countDownId", getCountDownId())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof CountDown) ) return false;
        CountDown castOther = (CountDown) other;
        return new EqualsBuilder()
            .append(this.getCountDownId(), castOther.getCountDownId())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getCountDownId())
            .toHashCode();
    }

}
